<?php

namespace app\admin\controller;
use think\Controller;
use app\teacher\security\TchCheck as TchCheckLogic;
use app\teacher\security\Auth as AuthLogic;
use think\Session;

class Config extends Controller
{
    /**
     * 管理员配置页面跳转
     * @access public
     * @return mixed 返回页面视图
     */
    public function config(){
        //检测教师登录情况
        $tchCheck=new TchCheckLogic();
        if($tchCheck->check()==1){
            //检测是否为管理员
            $auth=new AuthLogic();
            $username=Session::get('token')['tchUsername'];
            //if($auth->check('server',$username)){
                $result=getSrvConfig();
                if($result!==false){
                    $this->assign('config',$result);
                    $this->fetch('config/config');
                }else{
                    return "配置查询失败，请稍后再试";
                }
            }else{
                return "500：您没有管理员权限";
            }
       /* }else{
            return "600：您的登录信息出现问题，请重新登录"
            . "<br>" . "1.您的帐号在其他地方登录"
            . "<br>" . "2.您在线时间过长（5小时以上）"
            . "<br>" . "3.令牌验证错误";
        }*/
    }
}